#Global settings
AC_INIT([HaroldArena], [0.1], [])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

#Compilation settings
AC_PROG_CXX

AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile 
	 	 src/Makefile 
		 src/server/Makefile])

#Check dependancies
AC_LANG_PUSH(C++)

AC_CHECK_HEADERS([list		\
		  iostream	\
		  string	\
		  exception	\
		  ctime		\
		  sstream	\
		  fstream],, 
		  [AC_MSG_ERROR([Cannot find C++ std headers])])

AC_CHECK_HEADERS([boost/function.hpp	\
		  boost/bind.hpp	\
		  boost/shared_ptr.hpp],,
		 [AC_MSG_ERROR([Cannot find boost system headers])])

AC_CHECK_HEADERS([boost/asio.hpp],,
		 [AC_MSG_ERROR([Cannot find boost asio headers])])

AC_CHECK_LIB([boost_system], main, [BOOSTLIB=-lboost_system],
	     [AC_MSG_ERROR([Cannot find boost system library])])
AC_SUBST([BOOSTLIB])

AC_CHECK_LIB([pthread], main, [PTHREADLIB=-lpthread],
	     [AC_MSG_ERROR([Cannot find pthread library])])
AC_SUBST([PTHREADLIB])

AC_LANG_POP(C++)

#Output
AC_OUTPUT
